using System;
using System.IO;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.Design;

namespace GCFlashControl
{
	namespace Design
	{
		class GCFlashControlDesigner : ControlDesigner
		{
			// private member variables
			private GCFlashControl gcFlashControlInstance;		// an instance of the class

			public override void Initialize(System.ComponentModel.IComponent component)
			{
				gcFlashControlInstance = (GCFlashControl)component;
				base.Initialize(component);
			}

			#region GetDesignTimeHtml Method
			public override string GetDesignTimeHtml()
			{
				StringWriter sw = new StringWriter();
				HtmlTextWriter writer = new HtmlTextWriter(sw);

				// output a label that defines the template

				gcFlashControlInstance.DataBind();

				// get the HTML produced by the control
				gcFlashControlInstance.RenderControl(writer);
				return sw.ToString();
			}
			#endregion
		}
	}	
}
